import Vue from 'vue'
import Router from 'vue-router'
import newsindex from '@/components/news/index'
import newsinfo from '@/components/news/newsinfo'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'news',
      component: newsindex,
      meta: {
        keepAlive: true // 需要缓存
      }
    },
    {
      path:'/newsinfo/:id',
      name:'newsinfo',
      component:newsinfo,
      meta: {
        keepAlive: false // 不需要缓存
      }
    }
  ]
})
